Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more functions to CompressedResource #123

Merged
merged 7 commits into from
Oct 9, 2024

Conversation

chocolatkey
Copy link
Member

@chocolatkey chocolatkey commented Sep 20, 2024

Previously, the CompressedResource interface was added, to possibly stream resources in their original compressed format, to avoid having to decompress responses server-side before sending to the client.

This PR adds the ReadCompressed function to that interface, so that resources are not just streamed, but can also be read as a []byte in compressed form.

It also now adds GZIP versions of the stream/read functions directly in the toolkit, to make sending responses to clients that do not support deflate possible. This is particularly useful when placing the server behind a CDN like Cloudflare, that does not send deflate in its accept-encoding header.

@chocolatkey chocolatkey changed the title Add ReadCompressed function to CompressedResource Add more functions to CompressedResource Sep 21, 2024
@mickael-menu mickael-menu merged commit 9305ff9 into develop Oct 9, 2024
4 checks passed
@mickael-menu mickael-menu deleted the feature-read-compressed branch October 9, 2024 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants